package com.sunwayworld.basemodule.business.qualitycontrol.qualitycontrolplan.resource.impl;

import com.alibaba.fastjson.JSONObject;
import com.sunwayworld.basemodule.business.qualitycontrol.qualitycontrolplan.resource.LimsQualitycontrolplanProjectResource;
import com.sunwayworld.basemodule.business.qualitycontrol.qualitycontrolplan.service.LimsQualitycontrolplanProjectService;
import com.sunwayworld.framework.log.annotation.Log;
import com.sunwayworld.framework.log.annotation.LogModule;
import com.sunwayworld.framework.log.annotation.LogType;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;
import com.sunwayworld.framework.spring.annotation.GikamBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@LogModule("质控项目表")
@RestController
@GikamBean
public class LimsQualitycontrolplanProjectResourceImpl implements LimsQualitycontrolplanProjectResource {

    @Autowired
    private LimsQualitycontrolplanProjectService limsQualitycontrolplanProjectService;

    @Override
    public LimsQualitycontrolplanProjectService getService() {
        return limsQualitycontrolplanProjectService;
    }

    @Log(value = "新增质控项目表", type = LogType.INSERT)
    @Override
    @RequestMapping(method = RequestMethod.POST)
    public Long insert(RestJsonWrapperBean wrapper) {
        return getService().insert(wrapper);
    }

    @Override
    public JSONObject getControlRuleSelections(RestJsonWrapperBean jsonWrapperBean) {
        return getService().getControlRuleSelections(jsonWrapperBean);
    }
}
